<?php
if(!defined('BASEPATH')) {
	exit('No direct script access allowed');
}

class search extends CI_Controller {
	function __construct() {
		parent::__construct();
		$this->load->helper('url');
		$this->load->model('search_model');
	}
	
	/**
	 *查询所有结果
	 */
	function searchIndex() {
		$keys = $_POST['keys'];
		$ds['keyword'] = $keys;
		$this->load->view('search',$ds);
	}
	/**
	 *查询个人
	 */
	function listPersons() {
		$key = $_POST['key'];
		$results = $this->search_model->listPersonsByKey($key);
		$data['results'] = $results;
		$this->load->view("search_person",$data);
	}
	/**
	 *查询团队
	 */
	function listTeams() {
		$key = $_POST['key'];
		$results = $this->search_model->listTeamsByKey($key);
		$data['results'] = $results;
		$this->load->view("search_team",$data);
	}
}
?>